package top.zerozoo.learn.grade.vo;


import java.util.HashMap;
import java.util.Map;

/**
 * 学生列表联合搜索的条件 封装类
 * 用于list页面
 */
public class StudentListCondition {
    private String name = "";
    private String major = "";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    public Map<String,String> getConditionMap(){
        Map<String,String> map = new HashMap<>();
        map.put("name","%"+name+"%");
        map.put("department",major);
        return map;
    }

    @Override
    public String toString() {
        return "StudentListCondition{" +
                "name='" + name + '\'' +
                ", major='" + major + '\'' +
                '}';
    }
}
